package com.zhuangwei.sell.utils;

import com.zhuangwei.sell.vo.ResultVo;

/**
 * @author LeviCoder
 * @create 2019-02-28 23:49
 */
public class ResultVoUtil {

    public static ResultVo success(Object o){
        ResultVo resultVo = new ResultVo();
        resultVo.setData(o);
        resultVo.setCode(0);
        resultVo.setMsg("成功");
        return resultVo;
    }

    public  static ResultVo success(){
        return success(null);
    }

    public  static ResultVo error(Integer code,String msg){
        ResultVo resultVo = new ResultVo();
        resultVo.setCode(code);
        resultVo.setMsg(msg);
        return resultVo;
    }
}
